<?php 

$pdo = new PDO('mysql:host=localhost;dbname=danmu;charset=utf8','root','');

$sql = 'select danmu form danmu';

$stmt = $pdo->query($sql);

echo "[";
$first=0;
while($row=$stmt->fetch()){
	if ($first) {
		echo ",";
	}
	$first=1;
	echo "'".$row['danmu']."'";
}
	echo "]";





?>
